package pers.xiaojun.boot.module.system.dao.mapper.tenant;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import pers.xiaojun.boot.module.system.dao.entity.tenant.TenantPackageDO;

/**
 * 租户套餐数据访问层
 *
 * @author xiaojun
 * @since 2025-11-22
 */
@Mapper
public interface TenantPackageMapper extends BaseMapper<TenantPackageDO> {


    /**
     * 根据套餐名称获取套餐信息
     *
     * @param name 套餐名称
     * @return 套餐信息
     */
    default TenantPackageDO selectByName(String name) {
        return selectOne(new LambdaQueryWrapper<TenantPackageDO>()
                .eq(TenantPackageDO::getName, name)
        );
    }

}
